Communication apparatus, control method of communication apparatus, computer program, and storage medium

ABSTRACT

A communication apparatus connectable to a communication network notifies the presence of the communication apparatus using a communication channel assigned to the communication apparatus, then sets one communication channel different from the assigned communication channel of those available in the communication network, and searches for a communication partner apparatus which functions as a providing apparatus that provides communication parameters using the set communication channel. The communication apparatus repetitively executes the notification processing and the search processing, and changes a communication channel used in the search processing every time the repetition is executed one or a plurality of number of times.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/817,781, filed Aug. 4, 2015, which is a continuation of U.S. Pat. No.9,125,237, filed Apr. 5, 2011, which is the U.S. National StageApplication of International Application No. PCT/JP2009/067283, filedSep. 28, 2009, which claims the benefit of and priority to JapanesePatent Application No. 2008-259997, filed Oct. 6, 2008, the entirecontents of each of which are hereby incorporated by reference herein intheir entirety.

TECHNICAL FIELD

The present invention relates to a communication apparatus,communication method, computer program, and storage medium.

BACKGROUND ART

In wireless communications represented by wireless LANs compliant withthe IEEE802.11 standard series, there are many setting items which haveto be set before use. For example, such setting items includecommunication parameters required to make wireless communications suchas an SSID as a network identifier, encryption method, encryption key,authentication method, and authentication key, and it is verytroublesome for the user to manually input these parameters.

Hence, various manufacturers have proposed automatic setting methodsthat allow the user to easily set communication parameters in wirelessapparatuses. With these automatic setting methods, one apparatusprovides communication parameters to the other apparatus usingprocedures and messages, which are determined in advance between theapparatuses to be connected, thus automatically setting thecommunication parameters.

Japanese Patent Laid-Open No. 2006-311139 (to be referred to as patentreference 1 hereinafter) discloses an example of automatic communicationparameter setting processing in a communication in a wireless LAN ad hocmode (to be referred to as an ad hoc communication hereinafter). Wi-FiCERTIFIED for Wi-Fi Protected Setup: Easing the User Experience for Homeand Small Office Wi-Fi Networks,http://www.wi-fi.org/wp/wifi-protected-setup (to be referred to asnon-patent reference 1 hereinafter) discloses “Wi-Fi Protected Setup”(to be abbreviated as WPS hereinafter) as the industry standardspecification of the automatic communication parameter settingprocessing between an access point (base station) and station (terminalstation). Also, Wi-Fi Protected Access Enhanced Security ImplementationBased on IEEE P802.11i standard (to be referred to as non-patentreference 2 hereinafter) discloses “Wi-Fi Protected Access” (to beabbreviated as WPA hereinafter) as the industry standard specificationof an encryption method, encryption key, authentication method,authentication key, and the like in wireless communication connectionprocessing.

With the WPS, since the roles of an apparatus for providing thecommunication parameters (to be referred to as a providing apparatushereinafter) and an apparatus which receives the communicationparameters (to be referred to as a receiving apparatus hereinafter) aredetermined in advance, the transfer direction of the communicationparameters is also uniquely determined.

However, when the roles of the providing apparatus and receivingapparatus are not determined in advance, the transfer direction of thecommunication parameters cannot be uniquely determined. In this case,when the user selects an apparatus to be used as a providing apparatusand that to be used as a receiving apparatus, user's operabilityimpairs.

Furthermore, when a plurality of apparatuses are selected as providingapparatuses, the receiving apparatus cannot discriminate a providingapparatus from which the communication parameters are to be received.

The aforementioned problems may also occur when a new apparatus is addedto a network already built between a plurality of apparatuses. In thiscase, it is desirable that an apparatus which is already a participantof the network serves as a providing apparatus, and a new apparatus as aprospective participant receives the communication parameters of thenetwork. However, since the roles of the providing apparatus andreceiving apparatus are not determined in advance, appropriatecommunication parameters cannot be set in the new apparatus as theprospective participant.

The aforementioned problems may also occur not only in the communicationparameters of wireless communications but also in those of wiredcommunications that require settings in communications betweenapparatuses.

DISCLOSURE OF INVENTION

One embodiment of the present invention provides a communicationapparatus which can set appropriate communication parameters withoutimpairing user's operability even when the roles are not determined inadvance in automatic communication parameter setting processing, and acontrol method thereof.

According to one aspect of the present invention, there is provided acommunication apparatus connectable to a communication network,comprising:

notification means for notifying the presence of the communicationapparatus using a communication channel assigned to the communicationapparatus;

search means for setting one communication channel different from theassigned communication channel of communication channels available inthe communication network, and searching for a communication partnerapparatus which functions as a providing apparatus that providescommunication parameters using the set communication channel; and

a control means for controlling the notification means and the searchmeans to alternately repeat the notification processing and the searchprocessing, and changing a communication channel used by the searchmeans every time the repetition is executed one or a plurality of numberof times.

According to another aspect of the present invention, there is provideda communication apparatus connectable to a communication network,comprising:

notification means for notifying the presence of the communicationapparatus using a predetermined communication channel of communicationchannels available in the communication network in response to a startinstruction of automatic communication parameter setting processing;

search means for searching for a communication partner apparatus whichfunctions as a providing apparatus that provides communicationparameters using the predetermined communication channel;

setting means for executing the automatic communication parametersetting processing with the communication partner apparatus found by thesearch means; and

restoring means for restoring the communication channel to acommunication channel before beginning of the automatic communicationparameter setting processing after completion of the automaticcommunication parameter setting processing.

According to another aspect of the present invention, there is provideda method of controlling a communication apparatus connectable to acommunication network, comprising:

a notification step of notifying the presence of the communicationapparatus using a communication channel assigned to the communicationapparatus;

a search step of setting one communication channel different from theassigned communication channel of communication channels available inthe communication network, and searching for a communication partnerapparatus which functions as a providing apparatus that providescommunication parameters using the set communication channel; and

a control step of controlling the notification step and the search stepto alternately repeat the notification processing and the searchprocessing, and changing a communication channel used in the search stepevery time the repetition is executed one or a plurality of number oftimes.

According to another aspect of the present invention, there is provideda method of controlling a communication apparatus connectable to acommunication network, comprising:

a notification step of notifying the presence of the communicationapparatus using a predetermined communication channel of communicationchannels available in the communication network in response to a startinstruction of automatic communication parameter setting processing;

a search step of searching for a communication partner apparatus whichfunctions as a providing apparatus that provides communicationparameters using the predetermined communication channel;

a setting step of executing the automatic communication parametersetting processing with the communication partner apparatus found in thesearch step; and

a restoring step of restoring the communication channel to acommunication channel before beginning of the automatic communicationparameter setting processing after completion of the automaticcommunication parameter setting processing.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing the arrangement of a communicationapparatus according to an embodiment of the present invention;

FIG. 2 is a block diagram showing software functions in the apparatusaccording to the embodiment of the present invention;

FIG. 3 is a diagram showing the first network arrangement according tothe embodiment of the present invention;

FIG. 4 is a sequence chart showing the operations of apparatuses A and Baccording to the embodiment of the present invention;

FIG. 5 is a diagram showing the second network arrangement according tothe embodiment of the present invention;

FIG. 6 is a flowchart showing the notification processing operation of aproviding apparatus according to the embodiment of the presentinvention;

FIG. 7 is a flowchart showing a proxy reply operation according to theembodiment of the present invention;

FIG. 8 is a flowchart showing a communication parameter automaticsetting operation according to the embodiment of the present invention;

FIG. 9 is a sequence chart showing the operations of apparatuses A, B,and C according to the embodiment of the present invention;

FIG. 10 is a table of supported authentication and encryption methods;

FIG. 11 is a comparison table of possessed keys and key exchangesequences in key exchange algorithms;

FIG. 12 is a sequence chart (No. 1) of key exchange processing;

FIG. 13 is a sequence chart (No. 2) of key exchange processing;

FIG. 14 is a sequence chart (No. 3) of key exchange processing;

FIG. 15 is a sequence chart (No. 4) of key exchange processing;

FIG. 16 is a flowchart showing a key exchange algorithm selectionalgorithm;

FIG. 17 is a flowchart showing a providing apparatus discoveryprocessing operation according to the first embodiment of the presentinvention;

FIG. 18 is a flowchart showing a providing apparatus discoveryprocessing operation according to the second embodiment of the presentinvention;

FIG. 19 is a timing chart showing a general providing apparatusdiscovery processing operation; and

FIG. 20 is a timing chart showing a providing apparatus discoveryprocessing operation according to the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION First Embodiment

A communication apparatus according to this embodiment will be describedin detail hereinafter with reference to the drawings. An example using awireless LAN system complaint with the IEEE802.11 series will bedescribed hereinafter, but a communication mode is not always limited toa wireless LAN compliant with the IEEE802.11.

The hardware arrangement in a case example suited to this embodimentwill be described below.

FIG. 1 is a block diagram showing an example of the arrangement of acommunication apparatus (providing apparatus or receiving apparatus)which can be connected to a communication network, according to anembodiment of the present invention. Reference numeral 101 denotes awhole apparatus. Reference numeral 102 denotes a control unit whichcontrols the whole apparatus by executing a computer program stored in astorage unit 103. The control unit 102 also executes communicationparameter setting control with another apparatus. Reference numeral 103denotes a storage unit which stores the computer program to be executedby the control unit 102, and various kinds of information such ascommunication parameters. Various operations to be described later areimplemented when the control unit 102 executes the computer programstored in the storage unit 103.

Reference numeral 104 denotes a wireless unit used to make wirelesscommunications. Reference numeral 105 denotes a display unit which makesvarious displays, and has a function that can output visuallyperceivable information like an LCD or LED or can output audibleinformation like a loudspeaker.

Reference numeral 106 denotes a setting button which gives a trigger tostart communication parameter setting processing. The control unit 102executes processing to be described later when it detects a user'soperation of the setting button 106.

Reference numeral 107 denotes an antenna control unit; and 108, anantenna. Reference numeral 109 denotes an input unit which allows theuser to make various inputs.

FIG. 2 is a block diagram showing an example of the arrangement ofsoftware functional blocks to be executed by respective apparatuses tobe described later in a communication parameter setting operation to bedescribed later.

Reference numeral 201 denotes a whole apparatus. Reference numeral 202denotes a communication parameter auto-setting function block. In thisembodiment, the communication parameter auto-setting function block 202automatically sets communication parameters required to make wirelesscommunications such as an SSID as a network identifier, encryptionmethod, encryption key, authentication method, and authentication key.

Reference numeral 203 denotes a packet receiving unit which receivespackets associated with various communications. The packet receivingunit 203 receives a beacon (notification signal). Reference numeral 204denotes a packet transmitting unit which transmits packets associatedwith various communications. The packet transmitting unit 204 transmitsa beacon. Note that the beacon is added with various kinds ofinformation (self-information) of a transmission source apparatus.

Reference numeral 205 denotes a search signal transmitting unit whichcontrols transmission of an apparatus search signal such as a proberequest. Note that the probe request can also be expressed as a networksearch signal used to search for a desired network. The search signaltransmitting unit 205 transmits the probe request. Also, the searchsignal transmitting unit 205 transmits a probe response as a replysignal to the received probe request.

Reference numeral 206 denotes a search signal receiving unit whichcontrols reception of an apparatus search signal such as a probe requestfrom another apparatus. The search signal receiving unit 206 receivesthe probe request. Also, the search signal receiving unit 206 receives aprobe response. Note that the apparatus search signal and its replysignal are added with various kinds of information (self-information) ofa transmission source apparatus.

Reference numeral 207 denotes a network control unit which controlsnetwork connections. The network control unit 207 executes, for example,connection processing to a wireless LAN ad hoc network.

In the communication parameter auto-setting function block, referencenumeral 208 denotes an automatic setting control unit which controlsvarious protocols in automatic communication parameter settingprocessing.

Reference numeral 209 denotes a communication parameter providing unitwhich provides communication parameters to a partner apparatus. Thecommunication parameter providing unit 209 executes providing processingin the automatic communication parameter setting processing (to bedescribed later) under the control of the automatic setting control unit208. Reference numeral 210 denotes a communication parameter receivingunit which receives communication parameters from a partner apparatus.The communication parameter receiving unit 210 executes receivingprocessing in the automatic communication parameter setting processing(to be described later) under the control of the automatic settingcontrol unit 208.

The automatic setting control unit 208 also determines whether or not anelapsed time period after the beginning of the automatic communicationparameter setting processing exceeds a limit time of that settingprocessing. When it is determined that the elapsed time period exceedsthe limit time, the setting processing is aborted under the control ofthe automatic setting control unit 208.

Reference numeral 211 denotes a role determination unit which determinesa role in the automatic communication parameter setting processing. Therole determination unit 211 executes role determination processing to bedescribed later.

Reference numeral 212 denotes a set notification control unit whichcontrols processing associated with start and completion notificationsof the automatic communication parameter setting processing. The setnotification control unit 212 executes transmitting/receiving processingof a start notification message, start notification reply message, andcompletion notification message in a providing apparatus to be describedlater.

Reference numeral 213 denotes a beacon control unit which controls thetransmission timings of a beacon (notification signal). A beacontransmission algorithm in an ad hoc network of an IEEE802.11 wirelessLAN will be described below.

Beacons are transmitted in an autonomous distributed manner in the adhoc network among all apparatuses which configure the network. A beacontransmission interval (beacon cycle) is determined by an apparatus whichcreated the ad hoc network first, and beacons are normally transmittedfrom arbitrary apparatuses at an interval of about 100 ms. Note that thead hoc network is formed when one arbitrary apparatus begins to transmitbeacons.

The beacon transmission timings are controlled by a parameter called acontention window (a random number generation range; to be abbreviatedas CW hereinafter). When a beacon transmission timing is reached, eachapparatus in the network calculates a random value (CWrand) within therange from 0 to the CW. A time period obtained by multiplying apredetermined constant interval (slot time) by this CWrand is set as awaiting time period (backoff time period) until beacon transmission.

As the waiting time period until beacon transmission is decremented bythe slot time, when the waiting time period reaches zero, a beacon istransmitted. If the apparatus receives a beacon from another apparatusbefore it transmits a beacon, the apparatus aborts the transmittingprocessing of a beacon.

With this control, collisions of beacons transmitted from respectiveapparatuses can be avoided. Since respective apparatuses on the ad hocnetwork select random numbers within the range from 0 to the CW, anapparatus, which selects a smallest CWrand, of those that configure thenetwork transmits a beacon.

For example, when an identical CW is set in the respective apparatusesas an initial value, the respective apparatuses have equal beacontransmission probabilities and, as a result, the numbers of timesbeacons are transmitted per unit time by the respective apparatusesbecome nearly the same. In other words, the transmission frequencies(transmission ratios) of beacons by the respective apparatuses becomethe same.

On the other hand, when one apparatus on the network sets the CW to be avalue smaller than the initial value, the probability that thisapparatus transmits a beacon becomes higher than other apparatuses. Thatis, the CW can be expressed as a parameter used to determine theprobability that a beacon is transmitted or the number of times beaconsare transmitted per unit time.

Also, the CW can be expressed as a parameter used to determine thetransmission ratio of beacons transmitted by each apparatus.Furthermore, the CW can also be expressed as a parameter used todetermine the beacon transmission timing or a waiting time period untilbeacon transmission.

Note that the CW value can be changed within the range from CWmin(minimum value) to CWmax (maximum value). When the CWmin is set, thenumber of times beacons are transmitted per unit time is maximized. Ineach apparatus, CWinit (>CWmin) is set as an initial value, and beaconsare transmitted using the initial value while no automatic communicationparameter setting processing is executed.

FIG. 3 is a diagram showing a communication apparatus A 300 (to bereferred to as apparatus A hereinafter) and communication apparatus B301 (to be referred to as apparatus B hereinafter). All theseapparatuses have the arrangements shown in FIGS. 1 and 2 describedabove.

Both apparatuses A and B respectively create a network A 302 (to bereferred to as network A hereinafter) and a network B 303 (to bereferred to as network B hereinafter) in a state in which whether theyserve as a communication parameter providing apparatus or a receivingapparatus is not determined.

Apparatuses A and B discover each other's apparatus, and determine whichapparatus serves as a providing apparatus. As a result, the apparatuswhich serves as the providing apparatus provides communicationparameters to that which serves as the receiving apparatus.

Networks A and B are ad hoc networks respectively created by apparatusesA and B. The ad hoc network is called an IBSS (Independent Basic ServiceSet), and respective networks are distinguished using BSSIDs as networkidentifiers. The BSSID is a network identifier which assumes a randomvalue generated by an apparatus that creates a network. Note that anSSID is a network identifier which can be set in advance in an apparatusor can be set to be an arbitrary value by the user, and is differentfrom the BSSID. As can be seen from the above description, the BSSID isnot a communication parameter which is provided from the providingapparatus to the receiving apparatus by the automatic communicationparameter setting processing.

FIG. 4 is a chart showing an example of the processing sequence when thesetting buttons 106 are pressed on apparatuses A and B, and theautomatic communication parameter setting processing is executed betweenapparatuses A and B.

When the setting buttons 106 are respectively pressed on apparatuses Aand B, apparatus A creates unique network A (F401), and apparatus B alsocreates unique network B (F402). Assume that the setting button 106 ofapparatus B is pressed earlier, and apparatus B creates a network first.

Each of apparatuses A and B is set as “providing apparatus candidate”indicating that their operation role (to be referred to as a rolehereinafter) is settled neither as a providing apparatus nor a receivingapparatus (F403, F404), and starts a timer T1 as a limit time until theoperation role is determined (F405, F406).

Apparatuses A and B transmit beacons (notification signals) (F407,F408). A beacon signal includes an information element which notifiesthat the apparatus has a automatic communication parameter settingprocessing function in the created network or the automatic settingprocessing is in progress. Also, the beacon may also include aninformation element indicating “providing apparatus candidate” as thecurrent role.

Since these beacons include different BSSIDs in correspondence withnetworks A and B, the apparatus which received the beacon can recognizea network to which the transmission source apparatus of that beaconbelongs.

Subsequently, apparatus B transmits search signal A (F409). The searchsignal A also includes an information element indicating that theapparatus has a automatic communication parameter setting processingfunction or the automatic setting processing is in progress, and aninformation element indicating “providing apparatus candidate” as thecurrent role, as in the beacon.

Upon reception of search signal A transmitted from apparatus B,apparatus A transmits search reply signal A to apparatus B (F410). Thesearch reply signal A also includes an information element indicatingthat the apparatus has a automatic communication parameter settingprocessing function or the automatic setting processing is in progress,and an information element indicating “providing apparatus candidate” asthe current role, as in the beacon and search signal A.

When the timer T1 of apparatus B has reached a time-out before noproviding apparatus is detected (F411), apparatus B sets “providingapparatus” as its operation role (F412).

Apparatus A transmits search signal A in turn (F413). Search signal Atransmitted from apparatus A also includes an information elementindicating that the apparatus has a automatic communication parametersetting processing function or the automatic setting processing is inprogress, and an information element indicating “providing apparatuscandidate” as the current role.

Upon reception of search signal A transmitted from apparatus A,apparatus B transmits search reply signal B to apparatus A (F414).Search reply signal B includes an information element indicating thatthe apparatus has a automatic communication parameter setting processingfunction or the automatic setting processing is in progress, and thecurrent role, as in the beacon and search signal A. At this time, sinceapparatus B determines “providing apparatus” as its operation role,search reply signal B includes an information element indicating“providing apparatus”. In addition to the information element indicating“providing apparatus” as the role, an information element indicatingthat the apparatus is ready to provide communication parameters may beadded.

Apparatus A receives search reply signal B transmitted from apparatus B,and confirms that the role of apparatus B is “providing apparatus”, andapparatus B is ready to provide communication parameters. Hence,apparatus A stops the timer T1 (F415), sets “receiving apparatus” as itsrole (F416), and participates in network B created by apparatus B(F417). Then, apparatuses A and B can exchange communication messages(protocol messages) to be exchanged in communication parameter automaticsetting protocol processing.

Note that the automatic setting protocol processing means processingwhich exchanges various communication messages that are set in advanceto provide communication parameters from a providing apparatus to areceiving apparatus. Note that the WPS calls this protocol processing as“Registration protocol” (see non-patent reference 1). In the followingdescription of this embodiment, for the sake of simplicity, thereceiving apparatus transmits a communication parameter setting launchmessage to the providing apparatus, and the providing apparatus executescommunication parameter providing processing to the receiving apparatusin response to this message. Then, upon completion of the communicationparameter providing processing, the providing apparatus transmits acommunication parameter setting completion message.

When apparatus A participates in network B in F417, since communicationparameters such as an encryption key and authentication key are not setin apparatus A, apparatuses A and B cannot make communications usingencryption and authentication.

Note that upon determining the role of the communication parameterproviding apparatus or receiving apparatus between apparatuses A and B,the search signal and search reply signal are used.

However, in place of exchanging the search signal and search replysignal, the roles may be determined using information of beacons whichare exchanged with each other.

When apparatus A participates in the network created by apparatus B, ittransmits a communication parameter setting launch message to apparatusB (F418), and apparatus B as the providing apparatus executescommunication parameter providing processing to apparatus A as thereceiving apparatus (F419). Upon completion of the communicationparameter providing processing, apparatus B transmits a communicationparameter setting completion message to apparatus A (F420). Then, thecommunication parameter setting processing is complete, andcommunication parameters are shared between apparatuses A and B.

Then, apparatuses A and B execute communication connection processingusing the shared communication parameters (F421).

Note that since the communication connection processing is startedsimultaneously with the end of the communication parameter settingprocessing, apparatuses A and B can communicate with each other withoutforcing the user to make any operation. In this case, an apparatus maytransmit a connection request signal which explicitly indicates thestart of the communication connection processing. In the ad hoc mode,although no association processing is executed unlike in aninfrastructure mode, the apparatus as a request source of connection canbe promptly recognized upon reception of the connection request signal.

In this embodiment, apparatus B transmits communication parameters ofnetwork B to apparatus A, and the communication connection processing isexecuted using these communication parameters. In this case, whenapparatus A transmits a connection request signal to apparatus B,apparatus B can detect that apparatus A participates in network B, andcan also easily obtain the number of participants.

Before the start of the communication connection processing, theapparatus may confirm the user whether or not to start connection, andmay start the communication connection processing in accordance with auser's operation. For example, upon completion of the communicationparameter setting processing, the display unit 105 may display a messagewhich prompts the user to select whether or not to start connection, andthe communication connection processing may be started in accordancewith a user's input from the input unit 109.

Apparatus B may transmit, to apparatus A, communication parameters whichindicate a network different from network B. For example, apparatus Bmay provide communication parameters required to communicate usingnetwork C to apparatus A, and apparatuses A and B may communicate witheach other using network C after the providing processing. In this case,apparatus A or B may start the communication connection processing inresponse to detection of the other apparatus on network C as a trigger.

FIG. 8 is a flowchart showing an example of the operation sequenceexecuted when the setting buttons 106 are pressed on apparatuses A andB, the operation roles of apparatuses A and B, that is, the providingapparatus and receiving apparatus are determined, and the automaticcommunication parameter setting processing is then executed.

Control executed by these two apparatuses will be described below withreference to this flowchart.

The setting button 106 is pressed to indicate the start of communicationparameter setting processing (S801).

The apparatus on which the setting button 106 has been pressed checks ifit is already a participant of a network at present (S802). Theapparatus is a participant of a network when it configures the networkusing communication parameters shared by communication parameter settingprocessing which has already been done with another apparatus. If theapparatus is already a participant of the network, it sets “providingapparatus” as its role so as to control another new apparatus toparticipate in the participating network (S815). The apparatus thenbegins to transmit beacons including, e.g., information indicating thatthe role is “providing apparatus” (S816).

After that, upon reception of a communication parameter setting launchmessage from a new apparatus as a prospective participant of thenetwork, the apparatus starts communication parameter providingprocessing (S817). That is, in the communication parameter providingprocessing started in step S817, when the apparatus is already aparticipant of the network, the apparatus provides communicationparameters of the network of which that apparatus is a participant. Notethat when the apparatus is already a participant of the network atpresent, it launches start notification processing shown in FIG. 6 (tobe described later). Assume that a beacon (notification signal), searchsignal (probe request), and search reply signal (probe response) includethe following information elements as mandatory elements or optionsdepending on signals:

-   -   an information element which notifies that the apparatus has an        automatic communication parameter setting processing function or        the automatic setting processing is in progress;    -   an information element indicating the role of the apparatus; and    -   an information element indicating whether or not a providing        function is active.

If it is determined in step S802 that the apparatus does not participatein any network, that apparatus creates a network by itself so as todetermine the operation role (S803), sets “providing apparatuscandidate” as the role (S804), and launches providing apparatusdiscovery processing to be described later (S805). Note that theapparatus creates a network on an arbitrary wireless LAN channel in stepS803. Note that the wireless LAN channel is a communication channel(frequency channel) authorized to be used in communications of thewireless LAN. For example, in case of a wireless LAN compliant with theIEEE802.11g, communication channels from 1ch to 13ch are available inJapan. The providing apparatus discovery processing in step S805 will bedescribed later with reference to FIGS. 17, 19, and 20.

As a result of the providing apparatus discovery processing, if anapparatus which has “providing apparatus” as its role is discovered(S806), the apparatus sets “receiving apparatus” as its role (S807), andparticipates in a network created by the providing apparatus (S808).After the apparatus participates in the network, the apparatus begins totransmit beacons including information indicating that the role is“receiving apparatus” (S809). Note that since the apparatus does notreceive any communication parameters provided from the providingapparatus at this time, it cannot make communications using encryptionand authentication in the network in which that apparatus has become aparticipant. The apparatus which has become a participant of the networktransmits a communication parameter setting launch message to theproviding apparatus so as to request to provide communicationparameters, and starts receiving processing of communication parametersfrom the providing apparatus (S810).

On the other hand, if an apparatus which has “providing apparatus” asits role cannot be discovered as a result of the providing apparatusdiscovery processing (S806), the apparatus sets “providing apparatus” asa role of the apparatus (S815) Then, the apparatus begins to transmitbeacons including information indicating that the role is “providingapparatus” (S816), and starts communication parameter providingprocessing upon reception of a communication parameter setting launchmessage from the receiving apparatus (S817). In the communicationparameter providing processing started in step S817, the apparatusprovides communication parameters of the network created in step S803 ifthe apparatus is not a participant of any network.

On the other hand, the apparatus, whose role is “receiving apparatus”and which has started receiving processing of communication parametersfrom the providing apparatus, confirms if the receiving processing ofthe communication parameters is complete (S811). If the receivingprocessing of the communication parameters is complete, that apparatusmakes a display indicating a success of the communication parametersetting processing to be identifiable by the user by controlling thedisplay unit 105 to display a message on an LCD, to flicker or light onan LED, to change the color of the LED, or to generate an arbitrarysound (S814), thus ending the processing (S822). If an error hasoccurred (S812), the apparatus notifies the error to be identifiable bythe user by similarly controlling the display unit 105 to display amessage on an LCD, to flicker or light on an LED, to change the color ofthe LED, or to generate an arbitrary sound (S813), thus ending theprocessing (S822).

On the other hand, the apparatus, whose role is “providing apparatus”and which has started communication parameter providing processing,confirms if the communication parameter providing processing is complete(S818). If the communication parameter providing processing is complete,that apparatus makes a display indicating a success of the communicationparameter setting processing to be identifiable by the user bycontrolling the display unit 105 to display a message on an LCD, toflicker or light on an LED, to change the color of the LED, or togenerate an arbitrary sound (S821), thus ending the processing (S822).If an error has occurred (S819), the apparatus notifies the error to beidentifiable by the user by controlling the display unit 105 to displaya message on an LCD, to flicker or light on an LED, to change the colorof the LED, or to generate an arbitrary sound (S820), thus ending theprocessing (S822).

FIG. 17 is a flowchart showing an example of the operation sequence uponexecution of the providing apparatus discovery processing in step S805in FIG. 8. The control of the providing apparatus discovery processingwill be described below with reference to this flowchart.

When the providing apparatus discovery processing is started, theapparatus starts the timer T1 (S1701). The apparatus transmits beacons(notification signals) on a communication channel on which the networkis created (to be referred to as a self channel hereinafter) (S1702). Inorder to determine the transmission interval of a beacon in the selfchannel and that of a search signal (probe signal) in othercommunication channels, the apparatus determines the beacon interval ofthe self channel (S1703). After the search signal is transmitted (afterprocessing of step S1707 to be described later), the apparatus waitsuntil the next beacon transmission timing determined by the beaconinterval.

The apparatus determines whether or not the timer T1 has reached atime-out (S1704). If the timer T1 has not reached a time-out yet, theapparatus transmits a beacon (notification signal) in the self channel(S1705). Note that the beacon transmission period may be determined bythe duration of the beacon interval or a random duration longer thanthat.

The apparatus sets a search channel (S1706). Upon setting the searchchannel, the apparatus executes, for example, the following processing.In case of a wireless LAN compliant with the IEEE802.11g in Japan,channels from 1ch to 13ch can be used as wireless LAN channels. In thisembodiment, the channel setting processing is executed as follows. Thatis, in the first search channel setting processing, 1ch is set. Afterthat, the channel number is incremented in increments of 1ch up to 13chevery time the processing in step S1706 is executed. Then, in theprocessing in step S1706 after 13ch is set, 1ch is set again. Note thatin the US, since channels 1ch to 11ch are available, when the settingprocessing is executed in turn from 1ch as in Japan, 1ch is set again innext step S1706 after 11ch is set.

In addition to the method of changing channels in increments of onechannel, a method of intermittently changing channels is also available.Owing to the radio property of the IEEE802.11g, since a radio wave leaksto neighboring channels albeit weakly, a search signal transmitted inone of the neighboring channels can be received, and a reply signal canbe returned. Hence, in the first channel setting processing, 2ch is setas a search channel, and a bandwidth from 1ch to 3ch can be searched.That is, a communication partner apparatus is searched over a bandwidthof three channels to have the set communication channel as the center.Likewise, in the second channel setting processing, 5ch is set to searcha bandwidth from 4ch to 6ch. After that, 8ch is set in the thirdprocessing, 11ch is set in the fourth processing, and 13ch is set in thefifth processing. In the sixth processing, the channel to be set isreturned to 2ch. Such search channel setting method can be used.

Note that the channel selection may adopt a random setting order inplace of the aforementioned sequential setting order, or searchprocessing may be executed a plurality of number of times using anidentical channel. Furthermore, in addition to the aforementionedmethods, channels may be grouped by a predetermined method, and searchprocessing may be executed for respective groups.

As described above, the search channel setting processing in step S1706is processing which changes a channel to be set according to apredetermined algorithm.

The description will revert to the flowchart shown in FIG. 17. Theapparatus transmits a search signal (probe request) onto thecommunication network using the search channel set in step S1706(S1707). After transmission of the search signal, the apparatus waitsfor reception of a search reply until the next beacon transmissiontiming (S1708). If no search reply is received when the next beacontransmission timing is reached, the process returns to step S1704 todetermine the remaining time period of the timer T1. If the timer hasnot reached a time-out yet, the apparatus repeats processing from beacontransmission using the self channel again.

If a search reply is received in step S1708, the apparatus confirms thecontents of the received search reply signal to determine if the role ofa partner apparatus is “communication parameter providing apparatus”(S1709). If the role of the partner apparatus is “communicationparameter providing apparatus”, the apparatus holds the search result(S1710), and ends the providing apparatus discovery processing. If therole of the partner apparatus is not “providing apparatus” as a resultof the determination processing in step S1709, the process returns tostep S1704 to determine the remaining time period of the timer T1. Ifthe timer has not reached a time-out yet, the apparatus repeatsprocessing from beacon transmission using the self channel again. Notethat if the timer T1 has reached a time-out in step S1704, it isdetermined that no providing apparatus is detected, thus ending theproviding apparatus discovery processing.

By executing the aforementioned providing apparatus discoveryprocessing, the beacon transmission using the self channel and thesearch processing using another channel can be alternately executed.

An example of executing the providing apparatus discovery processingwhile changing a channel used to transmit a beacon and that used totransmit a search signal and to wait for reception of a search replysignal, and the effect of that processing will be described below withreference to FIGS. 19 and 20.

FIG. 19 is a chart showing an example in which the processing shown inFIG. 17 is not executed, and a providing apparatus is explored whilechanging a channel in turn after transmission of beacons using the selfchannel. Apparatus A transmits beacons using the self channel duringonly a period (a). After that, apparatus A transmits a search signal,and waits for reception of a search reply while changing all channelsuntil a providing apparatus is discovered during a period (b).

On the other hand, apparatus B also transmits beacons using the selfchannel during only a period (d) as in apparatus A. After that,apparatus B transmits a search signal, and waits for reception of asearch reply while changing all channels until a providing apparatus isdiscovered during a period (e).

Assume that apparatus A transmits a search signal and waits forreception of a search reply signal using a channel in which apparatus Bforms a network, during a period (b′). In this case, since apparatus Bdoes not transmit any beacon using the self channel during the period(b′), it cannot receive the search signal from apparatus A, and cannotreturn any search reply signal.

Likewise, assume that apparatus B transmits a search signal and waitsfor reception of a search reply signal using a channel in whichapparatus A forms a network, during a period (e′). In this case as well,since apparatus A does not transmit any beacon using the self channelduring the period (e′), it cannot receive the search signal fromapparatus B, and cannot return any search reply signal.

In this way, when both the apparatuses execute the providing apparatusdiscovery processing, the beacon notification period of the self channelis short, and the interval until a beacon is notified using the selfchannel is long. Therefore, apparatus A cannot detect apparatus B, andapparatus B cannot detect apparatus A.

Hence, by executing the providing apparatus discovery processingdescribed in this embodiment, the possibility that such situation occurscan be reduced. FIG. 20 is a chart showing an example when apparatuses Aand B execute the providing apparatus discovery processing shown in FIG.17. Apparatus A transmits beacons using the self channel during a period(a). After that, apparatus A executes search processing using the firstchannel during a period (b). Apparatus A then transmits beacons againusing the self channel (c), and executes search processing using thesecond channel (d). In this way, apparatus A alternately executes thebeacon transmission using the self channel, and the search signaltransmission and search reply signal reception waiting processing usinganother channel.

Apparatus B also executes the same processing as in apparatus A. Withthis processing, for example, the period (d) in which apparatus Aexecutes the search processing using a channel in which apparatus Bforms the network overlaps a period (o) in which apparatus B notifiesbeacons. As a result, when apparatus B returns a search reply signal inresponse to a search signal transmitted from apparatus A, apparatus Acan detect apparatus B.

Likewise, a period (r) in which apparatus B executes the searchprocessing using a channel in which apparatus A forms the networkoverlaps a period (g) in which apparatus A notifies beacons. As aconsequence, when apparatus A returns a search reply signal in responseto a search signal transmitted from apparatus B, apparatus B can detectapparatus A.

As described above, by executing the providing apparatus discoveryprocessing described in this embodiment, the probability that a partnercommunication apparatus is detected can be increased.

Note that FIG. 17 has explained the method in which a providingapparatus which has started the communication parameter settingprocessing is searched for by waiting for reception of a probe responseto a probe request (active scan). Since a providing apparatus which isexecuting the communication parameter setting processing transmits abeacon added with additional information which means automaticcommunication parameter setting processing, a receiving apparatus mayuse a method of waiting for reception of that transmitted beacon for apredetermined period of time (passive scan).

Step S1709 has explained the method in which whether or not the role ofa partner included in the information element of the received searchreply signal is “providing apparatus” is determined. When the role of apartner included in the information element of the received search replysignal is “providing apparatus candidate”, whether or not “providingapparatus” is determined as the role may be determined using informationincluded in the search reply signal. More specifically, for example, anapparatus which transmits a search reply signal transmits the searchreply signal which stores an elapsed time period after pressing of thesetting button 106. The apparatus which received the search reply signalcompares the elapsed time period stored in the search replay signal withan elapsed time period after pressing of its own setting button 106. Asa result of comparison, if the setting button 106 of the apparatus thatreceived the search reply signal was pressed earlier than the apparatusthat transmitted the search reply signal, the apparatus that receivedthe search reply signal sets “providing apparatus” as the role, and theprocess advances to step S816.

On the other hand, as a result of comparison, if the setting button 106of the apparatus which transmitted the search reply signal was pressedearlier than the apparatus which received the search reply signal, theapparatus which received the search reply signal transmits anotification signal to the apparatus that transmitted the search replysignal, and the apparatus which received the notification signal may set“providing apparatus” as the role.

As described above, when the search reply signal includes a time atwhich a user operation was made to issue a start instruction of thecommunication parameter setting processing, and the discoveredcommunication partner apparatus is not settled as a providing apparatus,which apparatus is a providing apparatus can be determined withreference to that time. When the time included in the search replysignal is earlier than a time at which the start instruction of thecommunication parameter setting processing was issued to the apparatuswhich received the search reply signal, the communication partnerapparatus is determined as a providing apparatus. With this processing,a providing apparatus can be determined promptly. Note that informationto be compared is not limited to the elapsed time period after pressingof the button 106. For example, the MAC address of the apparatus may becompared, or a Timing Synchronization Function (TSF) value included inthe search reply signal may be compared.

A case will be described below wherein a new apparatus is added to analready existing ad hoc network using the automatic communicationparameter setting processing. Note that the already existing ad hocnetwork indicates an ad hoc network which is configured by a pluralityof apparatuses using communication parameters shared between theapparatuses which executed the communication parameter settingprocessing.

FIG. 5 is a diagram showing a first communication apparatus A 500 (to bereferred to as apparatus A hereinafter), second communication apparatusB 501 (to be referred to as apparatus B hereinafter), thirdcommunication apparatus C 503 (to be referred to as apparatus Chereinafter), and network 502. Apparatuses A, B, and C have theaforementioned arrangements shown in FIGS. 1 and 2.

A case will be examined below wherein when apparatus C is about toparticipate in the network 502 configured by apparatuses A and B, thesetting buttons of apparatuses B and C are operated.

FIG. 6 is a flowchart for explaining the notification processingoperation of a providing apparatus. When an apparatus is already aparticipant of the network in step S802 in FIG. 8, that apparatus startsthe processing shown in FIG. 6.

When the processing is started, the beacon control unit 213 of theproviding apparatus increases the beacon transmission frequency(transmission ratio, the number of times of transmission) per unit timeby the providing apparatus (S601).

Note that the ad hoc network of the IEEE802.11 wireless LAN specifiesthat an apparatus which returns a probe response is an apparatus whichtransmitted a beacon immediately before reception of a probe request.

Then, in step S601 the providing apparatus sets the CW to be a valuesmaller than the initial value. With this setting, the number of timesbeacons are transmitted per unit time by the providing apparatus becomeslarger than other apparatuses which are participants of the network. Asa result, in the providing apparatus search processing (step S805 inFIG. 8) by a new apparatus as a prospective participant, a proberesponse from the providing apparatus can be detected within a shortperiod of time.

In this manner, since the beacon transmission frequency of the providingapparatus is increased, when a new apparatus as a prospectiveparticipant searches for a providing apparatus, it can receive a proberesponse from the providing apparatus at a higher probability. When thenew apparatus as a prospective participant searches for a providingapparatus by a passive scan, it can receive a beacon from the providingapparatus at a higher probability.

As a result, the probability that the limit time of the communicationparameter setting processing elapses while a new apparatus as aprospective participant cannot detect the providing apparatus can bereduced. When the new apparatus as the prospective participant candetect a providing apparatus within a short period of time, a timeperiod required until completion of the communication parameterproviding processing can be shortened.

After that, the providing apparatus broadcasts a start notificationmessage that notifies the start of the automatic communication parametersetting processing (S602). Note that the providing apparatus may unicastthis start notification message to each apparatus as a participant ofthe network. This start notification message can also be expressed as amessage which notifies that apparatus B started an operation as aproviding apparatus.

The providing apparatus waits until the launched providing processing isterminated as an error (S606), the communication parameter providingprocessing to the receiving apparatus is complete (S603), or it receivesan error notification or completion notification message from anotherapparatus (S605, S608).

If the providing processing has succeeded, that is, if the communicationparameter providing processing to the receiving apparatus is complete(S603), the providing apparatus broadcasts a completion notificationmessage (S604). Note that the providing apparatus may unicast thiscompletion notification message to each apparatus as a participant ofthe network.

If the providing apparatus transmits the completion notification messagein step S604 or it receives a completion notification message fromanother apparatus (S605), the process jumps to step S609.

If the providing processing has failed (S606), the providing apparatusbroadcasts an error notification message (S607). Note that the providingapparatus may unicast the error notification message to each apparatusas a participant of the network.

If the providing apparatus transmits the error notification message instep S607 or it receives an error notification message from anotherapparatus (S608), the process advances to step S609.

In step S609, the beacon control unit 213 of the providing apparatusre-sets the CW to be the initial value to restore the beacontransmission frequency increased in step S601 (S609). Note that there-setting timing of the CW to the initial value is not particularlylimited as long as the CW is re-set after the beginning of the providingprocessing. That is, the CW may be re-set immediately after thebeginning of the processing, after completion of the providingprocessing, or after an error. If the CW is re-set immediately after thebeginning of the processing, since the beacon transmission frequency(the number of times of transmission) is decreased, consumption powerrequired for beacon transmission can be efficiently reduced. The startnotification message transmitted in step S602 is repetitivelytransmitted until the providing processing is terminated as an error,communication parameters are provided to the receiving apparatus, or anotification message is received from another apparatus.

FIG. 7 is a flowchart for explaining the proxy reply processingoperation of an apparatus (apparatus A) as a participant of the networkother than the providing apparatus. When apparatus A receives the startnotification message, the processing shown in FIG. 7 is started.

Upon detection of reception of the start notification message, theautomatic setting control unit 208 of apparatus A launches a timer usedto determine if a limit time of processes to be described in steps S702to S707 has elapsed (S701).

The automatic setting control unit 208 then changes the contents ofinformation to be included in a beacon and search reply signal (proberesponse) to be transmitted (S702). In step S702, the automatic settingcontrol unit 208 adds identification information used to uniquelyidentify a providing apparatus (apparatus B) to the beacon and searchreply signal to be transmitted. As the identification information, forexample, MAC address information of the providing apparatus is stored.In this way, even when apparatus A which is not a providing apparatusreturns a search reply signal, an apparatus as a transmission source ofa search signal can detect the presence of a providing apparatus.

The beacon control unit 213 sets the CW to be a value larger than theinitial value (S703) to decrease the beacon transmission frequency(transmission ratio).

Hence, the number of times beacons are transmitted per unit time by theapparatus as a participant of the network other than the providingapparatus is smaller than the providing apparatus. As a result, in theproviding apparatus search processing (step S805 in FIG. 8) by a newapparatus as a prospective participant, a probe response from theproviding apparatus can be detected within a short period of time.

After that, apparatus A waits for a completion notification message orerror notification message transmitted from the providing apparatus(S704, S705). Upon reception of the notification message, the beaconcontrol unit 213 of apparatus A re-sets (restores) the CW to be theinitial value to restore the beacon transmission frequency decreased instep S703 (S706). Furthermore, the automatic setting control unit 208restores the contents of information to be included in a beacon andsearch reply signal to be transmitted to those before change in stepS702 (S707). That is, the automatic setting control unit 208 removes theidentification information which is used to uniquely identify theproviding apparatus (apparatus B) and is added to the beacon and searchreply signal to be transmitted.

Note that if the timer set in step S701 has reached a time-out, thereceiving apparatus aborts the processes in steps S702 to S707. If theprocesses in steps S702 and S703 have already been done at the timertime-out timing, the re-setting processing is executed as in steps S706and S707.

FIG. 9 is a sequence chart for explaining the operations of therespective apparatuses in this embodiment. Apparatus A receivescommunication parameters provided from apparatus B by the automaticcommunication parameter setting processing, and is already a participantof the network 502 defined by those communication parameters (F901).Apparatus C has not undergone the communication parameter providingprocessing yet.

When the user operates the setting button of apparatus B, apparatus Blaunches the processing shown in FIG. 8 (F902). Since apparatus B isalready a participant of the network 502 using the communicationparameters shared with apparatus A by the automatic communicationparameter setting processing, it sets “providing apparatus” as the role,and starts communication parameter providing processing (F902).

Apparatus B launches the start notification processing shown in FIG. 6(F903). After the start notification processing is launched, apparatus Btransmits a start notification message, and increases the beacontransmission frequency (F904).

Apparatus A which received the start notification message launches theproxy reply processing shown in FIG. 7, and decreases the beacontransmission frequency (F905).

In this manner, when apparatus B increases the beacon transmissionfrequency and apparatus A decreases the beacon transmission frequency,apparatus C as a new prospective participant can detect apparatus B asthe providing apparatus within a shorter period of time.

When the user operates the setting button 106 of apparatus C, apparatusC launches the processing shown in FIG. 8. Since apparatus C is not aparticipant of the network, it executes processing for creating anetwork, setting “providing apparatus candidate” as its role, and soforth, and then starts providing apparatus search processing. Note thatFIG. 9 shows the search processing and subsequent processes, and doesnot show processes before them. Apparatus C transmits a search signal soas to detect a providing apparatus (F906).

On the network 502, apparatus A or B returns a search reply signal inresponse to the search signal transmitted from apparatus C (F907 a, F907b).

When apparatus A returns the search reply signal, it returns the searchreply signal which stores the identification information (MAC address)of apparatus B as a providing apparatus (F907 b). When apparatus Breturns the search reply signal, it returns the search reply signalwhich stores information indicating that it is a providing apparatus(F907 a). In this way, even when apparatus C receives the search replysignals from any apparatuses on the network 502, it can surely detectapparatus B as the providing apparatus.

Upon detection of the presence of the providing apparatus, apparatus Csets “receiving apparatus” as its role (F908). Then, apparatus Cparticipates in the network 502, and receives communication parametersrequired to make communications on the network 502 from apparatus B asthe providing apparatus (F909).

After apparatus B provides the communication parameters to apparatus C,it transmits a completion notification message to apparatus A (F910).After transmission of the completion notification message, apparatus Brestores the beacon transmission frequency increased in F903. Uponreception of the completion notification message, apparatus A restoresthe beacon transmission frequency decreased in F905.

As described above, the user can automatically control apparatus C toparticipate in the network 502 by operating only the setting button 106.

Note that FIG. 9 has explained the case in which the setting button 106of apparatus B is operated. Also, a case in which the setting button 106of apparatus A is operated may be assumed. Even when the setting button106 of apparatus A is operated, since apparatus A becomes the providingapparatus via step S802 in FIG. 8, it can add apparatus C to the network502 in the same manner as in FIG. 9.

With the aforementioned processing, the communication apparatuses caneasily share the communication parameters. As described above, byoperating the setting buttons 106 on apparatuses A and B, communicationconnection processing is executed between apparatuses A and B toconfigure the network 502.

The communication connection processing may be automatically startedafter completion of the communication parameter setting processing, asdescribed above, or it may be started in response to a re-pressingoperation of the setting button 106 or a connection command entry by theinput unit 109.

Note that the communication connection processing differs depending onthe authentication method and encryption method of the sharedcommunication parameters.

In this embodiment, combinations adopted as the authentication methodand encryption method are as shown in, for example, FIG. 10.

Open authentication is an authentication method defined as “Open SystemAuthentication” in the IEEE802.11 standard, and please refer to theIEEE802.11 standard for details. Shared authentication is anauthentication method defined as “Shared Key Authentication” in theIEEE802.11 and IEEE802.11i standards, and uses a WEP protocol as anencryption method.

Note that “WEP” is an abbreviation for “Wired Equivalent Privacy”, andplease refer to the IEEE802.11 or IEEE802.11i standard for details.Also, a WPA authentication method, WPA-PSK authentication method, WPA2authentication method, and WPA2-PSK authentication method are thestandards of authentication methods specified by the Wi-Fi Alliance.These methods are based on an RSNA (Robust Security Network Association)in the IEEE802.11i standard.

“TKIP” is an abbreviation for “Temporal Key Integrity Protocol”. Also,“CCMP” is an abbreviation for “CTR with CBC-MAC Protocol”, and uses anAES protocol as an encryption method. “AES” is an abbreviation for“Advanced Encryption Standard”.

Please refer to the Wi-Fi Alliance specification or test specificationfor details of these methods. The WPA-PSK and WPA2-PSK authenticationmethods are those using a pre-shared key. The WPA and WPA2authentication methods require user authentication by an authenticationserver, which is prepared separately, and acquire an encryption key of acommunication channel from the authentication server. Please refer tothe IEEE802.11i standard for details of these methods.

The connection processing method differs depending on authenticationmethods. The authentication methods that can be supported currentlyinclude six different methods, that is, the Open authentication, Sharedauthentication, WPA authentication, WPA-PSK authentication, WPA2authentication, and WPA2-PSK authentication, as shown in the table. Ofthese methods, the WPA authentication and WPA2 authentication, and theWPA-PSK authentication and WPA2-PSK authentication are essentially thesame authentication methods. For this reason, the WPA and WPA2authentication methods and the WPA2 and WPA2-PSK authentication methodsare considered as the same methods, and four different authenticationmethods (Open, Shared, WPA, and WPA-PSK) will be explained below.

However, since the WPA authentication requires an independentauthentication server which is externally set, and executesauthentication processing with that authentication server, complicatedprocessing is required when all communication apparatuses operate on anequal footing like in the present invention. Hence, a description of theWPA authentication will not be given.

In this embodiment, the Open authentication, Shared authentication, andWPA-PSK authentication will be respectively explained below.

The Open authentication will be described first. In the Openauthentication, communication apparatuses set communication parametersshared by the automatic communication parameter setting processing, andsearch for each other's apparatus to configure an IBSS network.

The Shared authentication will be described below. A detaileddescription of the Shared authentication will not be given since it isincluded in the IEEE802.11 and IEEE802.11i specifications. Upon carryingout the Shared authentication, a Requester and Responder have to bedetermined.

In the infrastructure mode, an STA (station) operates as a Requester,and an AP (access point) operates as a Responder. On the other hand, inthe ad hoc mode, no AP exists. For this reason, in order to implementthe Shared Key Authentication in the IBSS network, the STA has toinclude a Responder function and a Requester/Responder roledetermination algorithm.

This Requester/Responder role determination algorithm may adopt the samemethod as that of a Supplicant/Authenticator role determinationalgorithm in the WPA-PSK authentication to be described later. Forexample, in the automatic communication parameter setting processing, acommunication parameter providing apparatus may serve as a Responder,and a communication parameter receiving apparatus may serve as aRequester.

Finally, the WPA-PSK authentication will be explained. The WPA-PSKauthentication is standardized in the IEEE802.11i and WPA, and anoperation method in the IBSS network is also specified. FIG. 12describes a sequence specified in the IEEE802.11i. Please refer to theIEEE802.11i standard for details, and an overview will be explainedbelow.

Assume that apparatuses A and B which complete the automaticcommunication parameter setting processing exist. After completion ofthe automatic communication parameter setting processing, communicationconnection processing is executed using the automatically setcommunication parameters automatically or in response to a useroperation.

Apparatuses A and B search for each other's partner (F1201). If theseapparatuses can recognize with each other, one of apparatuses A and B,which has a larger MAC address, serves as an Authenticator, and theother apparatus serves as a Supplicant. Then, apparatuses A and Bexecute first 4-way handshake processing and group key handshakeprocessing (F1202 and F1203).

Note that the 4-way handshake processing is a mechanism which exchangesrandom numbers between the Authenticator and Supplicant, and generatesan encryption key of a unicast packet called a pairwise key based on apre-shared key for each session. The group key handshake processing is amechanism which sends an encryption key of a multicast packet orbroadcast packet possessed by the Authenticator.

After that, apparatuses A and B exchange the roles of the Authenticatorand Supplicant, and execute 4-way handshake processing and group keyhandshake processing again (F1204 and F1205). With the above processes,apparatuses A and B are allowed to make encrypted communications.

In this way, in case of the method fully compliant with the IEEE802.11ispecification, since the 4-way handshake processing and group keyhandshake processing are repeated a plurality of number of times, theoverall processing becomes redundant. Since the redundant processing andthe role determination algorithm are executed, much time is requireduntil completion of connection. Hence, a method for reducing theredundant processing and shortening a processing time can also be used.

There are some such methods, and in this case, the following fourmethods will be explained:

First method: 4-way handshake processes are combined into once;

Second method: Group keys are combined into one per network;

Third method: All of group keys and pairwise keys are combined to one;and

Fourth method: Key exchange is executed together in the automaticcommunication parameter setting processing.

FIG. 11 shows differences of the numbers of times of key exchangesequences and the numbers of possessed pairwise keys and group keys bythe aforementioned four methods.

The number of possessed keys will be explained first. When an ad hocIBSS network including n communication apparatuses is fully compliantwith the IEEE802.11i, n−1 pairwise keys as many as the number of othercommunication apparatuses are required. As for group keys, in additionto group keys as many as the number of other communication apparatuses,a total of two group keys, that is, a current group key and animmediately preceding group key for the apparatus are required. Thus,n+1 group keys are required in total. The reason why the two group keysfor the apparatus are required is that an apparatus having differentgroup keys exists in an identical network in a transition perioddepending on the group key handshake progress status.

In the first method, only the number of sequences is reduced, and thenumber of possessed keys remains unchanged.

In the second method, n−1 pairwise keys are similarly required, and onlyone group key is required in all.

In the third method, since a group key is used intact as a pairwise key,the number of pairwise keys becomes zero, and only one group key ispossessed.

In the fourth method, n−1 pairwise keys are similarly required. Sincerespective apparatuses may possess group keys, or one group key in all,n+1 group keys or only one group key may be required on a case-by-casebasis.

The number of key exchange sequences executed per other apparatus willbe described below. In case of the method fully compliant with theIEEE802.11i, 4-way handshake processing is executed twice and group keyhandshake processing is executed twice, as has been described using FIG.12.

In the first method, the number of times 4-way handshake processing isexecuted as redundant processing is reduced to one. The group keyhandshake processing is still executed twice.

In the second method, since only one combined group key is used in thenetwork, that key need only be distributed to a new terminal. Hence, thegroup key handshake processing is executed once. Also, the 4-wayhandshake processing may be executed once according to the first method,or twice in two ways according to the IEEE802.11i standard.

In the third method, since one key which is set in advance is used as apairwise key and group key, no key exchange sequence is executed.

In the fourth method, since processing equivalent to key exchangeprocessing is done in the WPS automatic communication parameter settingprocessing, no independent 4-way handshake processing is executed. Thegroup key handshake processing is executed an arbitrary number of times.

As has been described with reference to FIG. 11, these methods areadvantageous in terms of the number of key exchange sequences and thenumber of possessed keys compared to the aforementioned method fullycompliant with the IEEE802.11i standard.

The aforementioned four methods will be described in detail below usingthe sequence charts.

The first method will be described below with reference to FIG. 13.

Assume that apparatuses A and B which complete the automaticcommunication parameter setting processing exist. After completion ofthe automatic communication parameter setting processing, communicationconnection processing is executed using the automatically setcommunication parameters automatically or in response to a useroperation.

Apparatuses A and B search for each other's partner (F1301). If theseapparatuses can recognize with each other, one of apparatuses A and B,which has a larger MAC address, serves as an Authenticator, and theother apparatus serves as a Supplicant. Then, apparatuses A and Bexecute 4-way handshake processing and one group key handshakeprocessing (F1302 and F1303).

After that, apparatuses A and B exchange the roles of the Authenticatorand Supplicant, and execute the group key handshake processing again(F1304). With the above processing, communications are allowed.

As described above, with the first method, the number of times the 4-wayhandshake processing is executed, which is twice per apparatus pair inthe IEEE802.11i specification, is reduced to one.

Since the 4-way handshake processing is required to share a pairwise keybetween communication apparatuses which execute 4-way handshakeprocessing, if that processing is continuously executed twice, securitycannot be improved, resulting in redundant processing. Hence, in thefirst method, the conventional method is changed, and the number oftimes 4-way handshake processing is executed is reduced to one, therebyshortening a time required for normal connection processing.

The second method will be described below with reference to FIG. 14.Assume that apparatuses A and B which complete the automaticcommunication parameter setting processing exist. After completion ofthe automatic communication parameter setting processing, communicationconnection processing is executed using the automatically setcommunication parameters automatically or in response to a useroperation.

Apparatuses A and B search for each other's partner (F1401). If theseapparatuses can recognize with each other, one of apparatuses A and B,which has a larger MAC address, serves as an Authenticator, and theother apparatus serves as a Supplicant. Then, apparatuses A and Bexecute 4-way handshake processing and group key handshake processing(F1402 and F1403). With the above processing, communications areallowed.

In the IEEE802.11i specification, different group keys are set forrespective communication apparatuses. However, in the second method,only one combined group key per network is used.

Pairwise keys are prepared for respective communication channels, butone group key is commonly used per network. As a result, the group keyhandshake processing, which has to be executed twice in the methodcompliant with the IEEE802.11i, need only be executed once. Since onlyone group key is set, the encryption/description processing of abroadcast packet and multicast packet becomes simple because a differentkey need not be held for each apparatus which transmitted such packets.

The third method is the same as WPA-None (Optional IBSS GlobalPre-Shared Key System) described in non-patent reference 2.

Since details of the WPA-None are described in the aforementionedreference, a detail description thereof will not be given. In the normalWPA, a random number is applied to an element as a source of a pairwisekey by 4-way handshake processing to generate a session key. On theother hand, in the WPA-None, an element as a source of a pairwise key isapplied intact as a session key.

That is, a large characteristic feature of the third method lies in thatno key exchange processing is executed. Hence, the security becomeslower than the normal WPA connection processing, which generates asession key for each connection. Hence, when this method is adopted, theautomatic communication parameter setting processing is launched foreach connection, and communication keys of the shared communicationparameters are randomly generated for each connection, thereby improvingthe security.

The fourth method will be described below with reference to FIG. 15. Asdescribed previously using FIG. 4, the communication partner searchprocessing and role determination processing in the automaticcommunication parameter setting processing are executed (F1501).Subsequently, by the automatic communication parameter settingprocessing, communication parameters are transferred from acommunication parameter providing apparatus to a communication parameterreceiving apparatus (F1502). During the processing in F1502, keyexchange processing, which is not executed in the conventional method,is executed simultaneously with the communication parameter settingprocessing.

Upon simultaneous execution, for example, a random number used inmessage exchange processing of the communication parameter settingprocessing is also used as that of the key exchange processing. Hence,at the timing when F1502 ends, apparatuses A and B share a pairwise key.After completion of the automatic communication parameter settingprocessing, group key exchange processing is executed (F1503). Asdescribed above, the fourth method is characterized in that the keyexchange processing is executed together in the automatic communicationparameter setting processing.

With the fourth method, since pairwise keys between apparatuses aredifferent even in an identical network, the security can be improved.Since processing equivalent to 4-way handshake processing is executed inthe communication parameter setting processing, the total connectiontime can be shortened.

In this description, the group key exchange processing is separatelyexecuted. However, when the group key exchange processing is alsoexecuted in the communication parameter setting processing, the totalconnection time can be further shortened.

As for the aforementioned five methods including that compliant with theIEEE802.11i, a system may select one of these methods, and informationindicating a method to be used included in communication parameters maybe provided. Also, these methods may be dynamically switched dependingon the mode of automatic communication parameter setting processing.

A case will be described below with reference to FIG. 16 wherein themethods are dynamically switched depending on the mode of the automaticcommunication parameter setting processing.

Assume that WPA-PSK, WPA2-PSK, or the like, which requires key exchangeprocessing, is selected as communication parameters by the automaticcommunication parameter setting processing. In this case, a key exchangemethod which is already used in a network is determined (S1601). Withthis determination processing, if an arbitrary key exchange method isalready selected (Yes in S1601-2), that method is used intact. If nomethod is especially selected (No in S1601-2), an automaticcommunication parameter setting processing mode is determined (S1602).

The processing mode includes, for example, a mode in which communicationparameters set by the automatic communication parameter settingprocessing are permanently used, or the communication parameters areused as temporary session information. For example, in case of theprocessing mode which permanently uses the set communication parameters(a mode which uses identical communication parameters when a wirelesscommunication is made again after the power supply is turned off), amethod which assures high security (e.g., the first method or fourthmethod) is selected. In case of the mode which uses the communicationparameters as temporary session information (a mode which erases ordisables the set communication parameters once the power supply isturned off), a method which prioritizes the processing load oversecurity (e.g., the second method or third method) may be selected.

If a key exchange method to be used is not settled based on theprocessing mode (No in S1602-2), the number of communication apparatusesincluded in an identical network is determined (S1603). Then, a suitedkey exchange method is selected based on the number of communicationapparatuses (S1604). For example, in case of two communicationapparatuses, the method fully compliant with the IEEE802.11i or thefirst or fourth method is selected. In case of three or morecommunication apparatuses, the second or third method may be selected.

As described above, according to this embodiment, when the settingbutton of an apparatus as a participant of a network is operated, thatapparatus serves as a providing apparatus and executes communicationparameter providing processing. For this reason, when the user selectsan arbitrary apparatus without regarding a providing apparatus orreceiving apparatus from those as participants of the network, a newapparatus can receive provided communication parameters.

That is, by operating the setting button of an arbitrary apparatuswithout selecting any providing apparatus, a new apparatus can be addedto the network. Since the increased beacon transmission frequency isrestored after completion of the providing processing, consumption powerrequired for beacon transmission can be reduced. Note that when thebeacon transmission frequency is restored immediately after thebeginning of the communication parameter providing processing,consumption power required for beacon transmission can be reduced moreefficiently.

When a new apparatus is added to the network after the communicationparameters are easily and securely provided, options about key exchangealgorithms are increased, and a key exchange algorithm is automaticallydetermined and set, thus lowering user's stress upon forming a network.Also, a network can be securely, easily, and quickly formed.

Second Embodiment

In the first embodiment, in the providing apparatus discovery processingdescribed using FIG. 17, an apparatus alternately executes beacontransmitting processing on its wireless LAN channel, and providingapparatus discovery processing on another wireless LAN channel. Withthis processing, the apparatus and the other apparatus can easily detecteach other's apparatus. By contrast, the second embodiment will explainan example in which the providing apparatus discovery processing isexecuted on a predetermined wireless LAN channel.

FIG. 18 is a flowchart showing an example of the operation sequence ofproviding apparatus discovery processing to be executed in the secondembodiment.

Control of the providing apparatus discovery processing will bedescribed below with reference to this flowchart.

An apparatus starts the processing described using FIG. 8 in response toa start instruction of automatic communication parameter settingprocessing (pressing of the setting button 106), and starts theproviding apparatus discovery processing in step S805. After theproviding apparatus discovery processing is started, the apparatusstarts the timer T1 (S1801).

The apparatus changes a wireless LAN channel from the current wirelessLAN channel to a predetermined wireless LAN channel (S1802). Note thatas the predetermined wireless LAN channel, a predetermined one ofcommunication channels available in a communication network can be used.As the predetermined wireless LAN channel, a communication channel whichis not used in a normal communication of those available in acommunication network may be used. Using different communicationchannels as a communication channel used in a normal communication andthat used in the providing apparatus discovery processing, the providingapparatus discovery processing can be executed without influencing acommunication between other apparatuses.

After the wireless LAN channel is changed, the apparatus starts beacon(notification signal) transmitting processing (S1803). After the beacontransmitting processing is started, assume that the apparatus executesbeacon transmission control using a beacon interval based on theIEEE802.11 standard, and keeps transmitting beacon signals periodically.

The apparatus determines if the timer T1 has reached a time-out (S1804).If the timer T1 has not reached a time-out yet, the apparatus transmitsa search signal (probe request) (S1805). After the search signal istransmitted, the apparatus determines if a search reply is received(S1806). If no search reply is received, the process returns to stepS1804 to determine the remaining time period of the timer T1. If thetimer has not reached a time-out yet, the apparatus repeats processingfrom transmission of a search signal again.

If a search reply is received in step S1806, the apparatus confirms thecontents of the received search reply signal to determine if the role ofa partner apparatus is “communication parameter providing apparatus”(S1807). If the role of the partner apparatus is “communicationparameter providing apparatus”, the apparatus holds the search result(S1808), thus ending the providing apparatus discovery processing.

As a result of the determination processing in step S1807, if the roleof the partner apparatus is not “communication parameter providingapparatus”, the process returns to step S1804 to determine the remainingtime period of the timer T1. If the timer has not reached a time-outyet, the apparatus repeats processing from transmission of a searchsignal again. Note that if the timer T1 has reached a time-out in stepS1804, the apparatus determines that no providing apparatus is detected,thus ending the providing apparatus discovery processing.

Note that the automatic communication parameter setting processingexecuted by the communication parameter receiving processing in stepS810 and the communication parameter providing processing in step S817is executed using the predetermined communication channel. Hence, whenthe process advances from step S802 to step S815, the predeterminedcommunication channel is set as a communication channel in step S815.After the communication parameter providing processing has succeeded orit is terminated as an error, the communication channel is restored tothat before the beginning of the automatic communication parametersetting processing. In this embodiment, for example, the communicationchannel is restored in steps S820 and S821. Also, when the communicationparameter receiving processing is terminated as an error, thecommunication channel may be restored to that before the beginning ofthe automatic communication parameter setting processing. In thisembodiment, for example, the communication channel may be restored instep S813.

As described above, according to this embodiment, since the providingapparatus discovery processing is executed on the predetermined wirelessLAN channel, a providing apparatus can be detected very quickly.Communication connection processing may be interrupted during theautomatic communication parameter setting processing. However, since theproviding apparatus discovery processing ends quickly, an interruptedtime period of the communication connection processing can be shortened.

The preferred embodiments of the present invention have been described,but they are examples for the purpose of the description of the presentinvention, and the scope of the present invention is not limited to onlythese embodiments. Various modifications of the embodiments can be madewithout departing from the scope of the present invention.

In the examples described in the above embodiments, the CW value ischanged to increase the number of times beacons are transmitted per unittime by the providing apparatus to be larger than other apparatuses.However, other parameters may be used as long as the providing apparatuscan increase the number of times beacons are transmitted to be largerthan other apparatuses. For example, if the beacon transmission interval(beacon cycle) can be changed, the providing apparatus decreases thebeacon transmission interval, thus increasing the number of timesbeacons are transmitted per unit time.

In the above description, the CW is changed to be larger or smaller thanthe initial value. Since respective apparatuses do not always have thesame CW initial value, if the CW is changed to a minimum value (CWmin)or maximum value (CWmax) within a changeable range, the beacontransmission frequency (the number of times) can be changed morereliably. The start notification message is described as a message thatnotifies that the automatic communication parameter setting processingis started.

However, the start notification message can also be expressed as amessage which notifies the operation of the setting button 106 or amessage that allows the providing apparatus to provide communicationparameters to another receiving apparatus.

The above description has been given taking the wireless LAN compliantwith the IEEE802.11 as an example. However, the present invention may becarried out for other wireless media such as wireless USB, MBOA,Bluetooth®, UWB, and ZigBee. Also, the present invention may be carriedout for wired communication media such as a wired LAN.

Note that “MBOA” is an abbreviation for “Multi Band OFDM Alliance”.Also, the UWB includes wireless USB, wireless 1394, WINET, and the like.

The network identifier, encryption method, encryption key,authentication method, and authentication key have been exemplified asthe communication parameters. However, other kinds of information may beused, or other kinds of information may be included in the abovecommunication parameters.

As described above, according to the present invention, even when theroles are not determined in advance in automatic communication parametersetting processing, communication parameter setting processing andnetwork participating processing can be appropriately executed withoutany user's selections of the roles.

Other Embodiments

Aspects of the present invention can also be realized by a computer of asystem or apparatus (or devices such as a CPU or MPU) that reads out andexecutes a program recorded on a memory device to perform the functionsof the above-described embodiment(s), and by a method, the steps ofwhich are performed by a computer of a system or apparatus by, forexample, reading out and executing a program recorded on a memory deviceto perform the functions of the above-described embodiment(s). For thispurpose, the program is provided to the computer for example via anetwork or from a recording medium of various types serving as thememory device (e.g., computer-readable medium).

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

The invention claimed is:
 1. A communication apparatus comprising: oneor more computers that causes the communication apparatus to: executeshare processing for sharing a communication parameter; execute searchprocessing, by sending a probe request and receiving a probe response,to search a communication partner apparatus that executes the shareprocessing in a plurality of channels including a first channel and asecond channel, wherein the second channel is not adjacent to the firstchannel; execute wait processing, by waiting for a probe request from acommunication partner apparatus, wherein, in a case where thecommunication apparatus receives a probe request during execution of thewait processing, the communication apparatus responds by sending a proberesponse; and notifying an error in a case where an error occurs in theshare processing, wherein when the search processing in the firstchannel is finished, the communication apparatus execute the searchprocessing in the second channel without the search processing in athird channel which is adjacent to the first channel and length ofperiod for the wait processing is randomly determined.
 2. Thecommunication apparatus according to claim 1, wherein the communicationapparatus notifies a user of an error in a case where an error occurs inthe share processing.
 3. The communication apparatus according to claim1, wherein the communication apparatus displays on a display unit anmessage indicating an error in a case where an error occurs in the shareprocessing.
 4. The communication apparatus according to claim 1, whereinthe communication apparatus notifies success in a case where the shareprocessing is successful.
 5. The communication apparatus according toclaim 4, wherein the communication apparatus notifies a user of asuccess in a case where the share processing is successful.
 6. Thecommunication apparatus according to claim 4, wherein the communicationapparatus displays on a display unit a message indicating a success in acase where the share processing is successful.
 7. The communicationapparatus according to claim 1, wherein the one or more computersfurther cause the apparatus to: switch a processing from the waitprocessing using the channel to the search processing, and then, switcha processing from the search processing to the wait processing using thechannel.
 8. The communication apparatus according to claim 7, whereinthe communication apparatus switches a processing from the searchprocessing using the first channel to the wait processing using thechannel, and then, switches a processing from the wait processing usingthe second channel.
 9. The communication apparatus according to claim 1,wherein the one or more computers further cause the apparatus to:determine roles of the communication apparatus, wherein, in the shareprocessing, the communication apparatus provides the communicationpartner apparatus with the communication parameter in accordance withthe role determined by the communication apparatus.
 10. Thecommunication apparatus according to claim 9, wherein the communicationapparatus compares information received from the communication partnerapparatus and information relating to the communication apparatus, anddetermines the role based on a comparison result.
 11. The communicationapparatus according to claim 10, wherein information transmitted by thecommunication apparatus includes information indicating a roledetermined by the communication apparatus.
 12. The communicationapparatus according to claim 1, wherein the communication apparatussearches the communication partner apparatus by executing the searchprocessing using the plurality of channels from a plurality of availablechannels.
 13. The communication apparatus according to claim 1, whereinthe communication apparatus does not transmit a probe request during aperiod that the communication apparatus is executing the waitprocessing.
 14. The communication apparatus according to claim 1,wherein information transmitted by the communication apparatus includesinformation indicating that the communication apparatus has a functionto execute the share processing or information indicating that the shareprocessing is being executed.
 15. The communication apparatus accordingto claim 1, wherein the communication apparatus searches for thecommunication partner apparatus by executing the search processing,which transmits information indicating that a function for executing theshare processing is equipped or information indicating that the shareprocessing is being executed.
 16. The communication apparatus accordingto claim 1, wherein the communication apparatus searches for thecommunication partner apparatus by executing the search processing,which functions as a providing apparatus that provides a communicationparameter.
 17. The communication apparatus according to claim 1, whereinthe communication apparatus transmits a notification signal indicatingexistence of the communication apparatus using the channel during aperiod in which the communication apparatus is executing the waitprocessing.
 18. The communication apparatus according to claim 1,wherein the one or more computers further cause the apparatus to: allowanother communication apparatus to join a network established betweenthe communication apparatus and the communication partner apparatus. 19.The communication apparatus according to claim 1, wherein there is adifference by N channels (N>1) between the first channel and the secondchannel.
 20. The communication apparatus according to claim 19, whereinin a case where the search processing in the first channel is finished,the search processing in the second channel, which is increased by Nchannels from the first channel, is executed without executing thesearch processing in the third channel which is increased by one fromthe first channel.
 21. The communication apparatus according to claim19, wherein the N equals
 3. 22. The communication apparatus according toclaim 1, wherein the one or more computers further cause the apparatusto: determine, based on the received probe response, whether or not thecommunication partner apparatus which transmitted the probe response isa providing apparatus which provides communication parameters.
 23. Thecommunication apparatus according to claim 1, wherein the one or morecomputers further cause the apparatus to: receive a user's operationindicative of forming a network with the communication partnerapparatus, wherein the communication apparatus executes the searchprocessing to search the communication partner apparatus in response todetection of the user's operation.
 24. The communication apparatusaccording to claim 1, wherein the communication apparatus executes theshare processing based on a Registration protocol regulated in Wi-FiProtected Setup (WPS).
 25. The communication apparatus according toclaim 1, wherein the communication apparatus executes a 4-way handshakeregulated in IEEE802.11i and WiFi Protected Access (WPA) in a case wherethe communication apparatus connects to the communication partnerapparatus based on the communication parameter.
 26. The communicationapparatus according to claim 1, wherein the communication parameterincludes at least one of SSID (Service Set Identifier), an encryptionmethod, an encryption key, an authentication method, and anauthentication key.
 27. The communication apparatus according to claim1, wherein the communication parameter is a parameter for performing awireless communication compliant with the IEEE802.11 standard.
 28. Amethod of controlling a communication apparatus, the method comprising:executing share processing for sharing a communication parameter;executing search processing, by sending a probe request and receiving aprobe response, to search a communication partner that executes theshare processing in a plurality of channels including a first channeland a second channel, wherein the second channel is not adjacent to thefirst channel; executing wait processing, by waiting for a probe requestfrom a communication partner apparatus, wherein, in a case where a proberequest is received during execution of the wait processing, the waitprocessing responds by sending a probe response; and notifying an errorin a case where an error occurs in the share processing, wherein whenthe search processing in the first channel is finished, the searchprocessing is executed in the second channel without executing thesearch processing in a third channel which is adjacent to the firstchannel and length of period for the wait processing is randomlydetermined.
 29. A non-transitory computer-readable storage mediumstoring a program for causing a computer to execute a method ofcontrolling a communication apparatus, the method comprising: executingshare processing for sharing a communication parameter; executing searchprocessing, by sending a probe request and receiving a probe response,to search a communication partner that executes the share processing ina plurality of channels including a first channel and a second channel,wherein the second channel is not adjacent to the first channel;executing wait processing by waiting for a probe request from acommunication partner apparatus, wherein, in a case where a proberequest is received during execution of the wait processing, the waitprocessing responds by sending a probe response; and notifying an errorin a case where an error occurs in the share processing, wherein whenthe search processing in the first channel is finished, the searchprocessing is executed in the second channel without executing thesearch processing in a third channel which is adjacent to the firstchannel and length of period for the wait processing is randomlydetermined.